public class Main {
    public static void main1(String[] args) {
        int[]array=new int[100];
        for (int i = 0; i < 100; i++) {
            array[i]=i+1;
            System.out.println(array[i]);
        }
    }

    public static void printArray(int[]array) {
        for(int i=0;i< array.length;i++){
            System.out.println(array[i]);
        }
    }

    public static void main2(String[] args) {
        int[]array={1,2,3,4,5};
        printArray(array);
    }

    public static void transform(int[]array) {
        for (int i = 0; i < array.length ; i++) {
            array[i]=array[i]*2;
        }
    }

    public static void main3(String[] args) {
        int[]array={1,2,3,4,5};
        transform(array);
        printArray(array);
    }

    public static int sum(int[]array) {
        int a=0;
        for (int i = 0; i < array.length ; i++) {
            a+=array[i];
        }
        return a;
    }

    public static void main4(String[] args) {
        int[]array={1,2,3,4,5};
        int a=sum(array);
        System.out.println(a);
    }

    public static double avg(int[]array) {
        int a=0;
        for (int i = 0; i < array.length; i++) {
            a+=array[i];
        }
        double b=a*1.0/ array.length;
        return  b;

    }

    public static void main(String[] args) {
        int[]array={1,2,3,4,5,6,7,8};
        double a=avg(array);
        System.out.println(a);
    }
}